using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class LetterMap : EntityTypeConfiguration<Letter>
    {
        public LetterMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.NumLetter)
                .HasMaxLength(9);

            // Table & Column Mappings
            this.ToTable("Letters");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Units_id).HasColumnName("Units_id");
            this.Property(t => t.NumLetter).HasColumnName("NumLetter");
            this.Property(t => t.unitbase).HasColumnName("unitbase");
        }
    }
}
